/**
 * 使用 react-redux 的 hooks 的方式，勾出仓库中的数据
 */

import { useSelector, useDispatch } from "react-redux";

function Hello() {
  const count = useSelector((state: any) => state.count);

  const dispatch = useDispatch();

  return (
    <div>
      <h4>Hello - {count}</h4>
      <button onClick={() => dispatch({ type: "increment" })}>Add</button>
    </div>
  );
}

export default Hello;
